#Maintainer: Biswapriyo Nath <nathbappai@gmail.com>

_realname=xa65
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.3.12
pkgrel=2
pkgdesc="6502/65816 cross assembler"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
license=('GPL2')
url="http://www.floodgap.com/retrotech/xa/"
depends=()
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("http://www.floodgap.com/retrotech/xa/dists/xa-${pkgver}.tar.gz"
        "0001-make-fix-predefined-variables.patch")
sha256sums=('f8fd1536012d676fc6cbfcdd6a91793e564c89b6ef747f8db8f467c178fb0704'
            'f978c0540018ea819e97c958612af7effe0034981c294efbde8ee69ab4de08e1')

prepare() {
  cd ${srcdir}/xa-${pkgver}
  patch -p1 -i "${srcdir}/0001-make-fix-predefined-variables.patch"
}

build() {
  cd ${srcdir}/xa-${pkgver}
  make ${MAKEFLAGS}
}

package() {
  cd ${srcdir}/xa-${pkgver}
  make DESTDIR=${pkgdir}${MINGW_PREFIX} install
  install -Dm644 ${srcdir}/xa-${pkgver}/README.1st ${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/README
}
